package musicstore.com.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import musicstore.com.dao.AlbumDao;
import musicstore.com.dao.GenreDao;
import musicstore.com.dao.impl.AlbumDaoImpl;
import musicstore.com.dao.impl.GenreDaoImpl;
import musicstore.com.entity.Album;
import musicstore.com.entity.Genre;

public class indexServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		GenreDao genreDao = new GenreDaoImpl();
		List<Genre> genreList = genreDao.getGenreList();
		AlbumDao albumDao= new AlbumDaoImpl();
		List<Album> albumList = albumDao.getAlbumInfo();
		String username = (String)request.getSession().getAttribute("username");
		request.setAttribute("genre", genreList);
		request.setAttribute("album", albumList);
		
		request.getRequestDispatcher("Album.jsp").forward(request, response);
	}

}
